﻿namespace Digitalmes.Domain.Entities.Mes.Productions;

/// <summary>
/// 生产订单。
/// </summary>
[SugarTable("prod_order")]
public sealed class ProdOrder : AuditedEntity, ISoftDelete
{
    /// <summary>
    /// 订单编号
    /// </summary>
    [NotNull]
    public string? Code { get; set; }

    /// <summary>
    /// 订单名称
    /// </summary>
    [NotNull]
    public string? Name { get; set; }

    /// <summary>
    /// 产品 Id。
    /// </summary>
    public long ProductId { get; set; }

    /// <summary>
    /// 计划生产数量
    /// </summary>
    public int PlanQty { get; set; }

    /// <summary>
    /// 计划开始日期
    /// </summary>
    public DateTime PlanStartDate { get; set; }

    /// <summary>
    /// 计划完成日期
    /// </summary>
    public DateTime PlanEndDate { get; set; }

    /// <summary>
    /// 订单来源（手动导入、ERP下发）
    /// </summary>
    public int Source { get; set; }

    /// <summary>
    /// 描述
    /// </summary>
    public string? Remark { get; set; }

    /// <summary>
    /// 订单状态（0->初始化，1->已审核，2->生产中，3->已完工）
    /// </summary>
    public int Status { get; set; }

    public bool IsDeleted { get; set; }
}
